package nf.graph;

public class WrongGraphException extends IllegalArgumentException
{
	private Graph actualGraph;
	private Graph expectedGraph;
	
	public WrongGraphException()
	{
		this(null);
	}
	
	public WrongGraphException(String message)
	{
		this(message, null, null);
	}
	
	public WrongGraphException(String message, Graph expected, Graph actual)
	{
		super((actual != null && expected != null)
			? String.format("%s; expected %s but got %s",
				message, expected, actual)
			: message);
		actualGraph = actual;
		expectedGraph = expected;
	}
	
	/**
	 * Returns the graph that was expected
	 * @return Graph that was expected
	 */
	public Graph getExpectedGraph()
	{
	    return expectedGraph;
	}
	
	/**
	 * Returns the graph that was actually provided
	 * @return Graph that was actually provided
	 */
	public Graph getActualGraph()
	{
	    return actualGraph;
	}
	
}
